<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="./js/ajax.js"></script>
  <script>

    // 用户调用ajax()，
    ajax({
      url: "http://127.0.0.1:80/user/login",
      type: 'POST',
      data: { username: 'wenqingwu', password: '123456' }, //用户始终通过data属性传参数，他不管时get,post。
      success: (resData) => {
        console.log(resData);
      },
      dataType: 'json' //返回的数据类型
      // async: 123,
    })
  </script>
</body>

</html>